package com.zy.mc_module.utils.retrofit;

import io.reactivex.ObservableTransformer;
import io.reactivex.android.schedulers.AndroidSchedulers;
import io.reactivex.schedulers.Schedulers;

/**
 * Created on 18/10/22
 * Rx线程调度器 只做线程转换，不做任何数据处理
 */
public class RxTransform {

    /***
     * io to main
     * @param <T>
     * @return
     */
    public static <T> ObservableTransformer<T, T> schedule() {
        return upstream -> upstream.subscribeOn(Schedulers.io())
                .observeOn(AndroidSchedulers.mainThread());
    }
}
